Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom default config file #175

Merged
merged 2 commits into from
May 6, 2024
Merged

feat: custom default config file #175

merged 2 commits into from
May 6, 2024

Conversation

Ark2000
Copy link
Owner

@Ark2000 Ark2000 commented May 5, 2024

closes #173

Expected Behavior:

  1. user://panku_config.cfg file exists, that is used as the config dictionary
  2. If the user config file does not exist (for example, for first-time users), then use res://addons/panku_console/panku_default_config.cfg (which can be changed in project settings) as the config dictionary.
  3. The plugin will always get a config dictionary, whether the config files exist or not.
  4. If there's no corresponding key-value pair in the config dictionary, the default value in the function call will be used.

Note:
The user config file (which is located at user://) will always be created after the program starts, the default config file (located at res://) is in fact simply a read-only and for one use only template file.

@Ark2000 Ark2000 self-assigned this May 5, 2024
@Ark2000
Copy link
Owner Author

Ark2000 commented May 5, 2024

CC @worron @TheContainer
Please take it a look.

@TheContainer
Copy link

CC @worron @TheContainer Please take it a look.

Works for me!

Copy link
Collaborator

@worron worron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it brief testing and it works fine. There are some concerns inside get_config function, but it's rather cosmetic. Ready for merge overall, I think, pretty cool feature.

addons/panku_console/common/config.gd Outdated Show resolved Hide resolved
Co-authored-by: worron <worrongm@gmail.com>
@Ark2000 Ark2000 merged commit 6e8ad31 into master May 6, 2024
@Ark2000 Ark2000 deleted the feat branch May 6, 2024 02:53
@worron worron mentioned this pull request Jul 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the native logger "show if shell visible" setting default.
3 participants